package com.itheima.tlias;

import com.itheima.tlias.pojo.entity.Teacher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class TliasApplication {

    public static void main(String[] args) {
        SpringApplication.run(TliasApplication.class, args);
    }
    /**
     * 通过@Bean创建的Bean对象默认是创建该Bean的方法名
     * 一般用于自动配置第三方对象连接信息对象，例如 阿里云OSS
     */
    @Bean
    public Teacher createTeacherOne(){
        Teacher teacher = new Teacher();
        teacher.setName("张三");
        teacher.setAge(18);
        return teacher;
    }
    @Bean
    public Teacher createTeacherTwo(){
        Teacher teacher = new Teacher();
        teacher.setName("张三");
        teacher.setAge(18);
        return teacher;
    }

}
